package com.itfenghuang.day20;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.concurrent.Callable;

/*
过滤器
 */
public class A01_过滤器 implements Filter {
/*
1.概述
    javaWeb有三大组件:Servlet(接收请求,处理数据,响应用户) Filer(拦截)
        Listener(监听,可以监听域对象的变化)
2.入门案例
    1). 自定义类实现Filter接口,重写方法
    2). 在web.xml中配置filter
 */

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        HttpServletRequest req= (HttpServletRequest) servletRequest;
//        System.out.println("过滤器执行了吗");
//        放行
        filterChain.doFilter(servletRequest,servletResponse);
    }

}
